//
//  PTFunctionViewController.m
//  PuTie
//
//  Created by 周宏全 on 2017/7/14.
//  Copyright © 2017年 周宏全. All rights reserved.
//

#import "PTFunctionViewController.h"
#import "PTTopStatusViewController.h"
#import "PTButtomFuncViewController.h"
#import "Masonry.h"

@interface PTFunctionViewController ()

@end

@implementation PTFunctionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor orangeColor];
    
    // 调用添加视图
    [self addView];
    
}

#pragma mark - 添加视图
- (void) addView {
    
    // 创建顶部状态栏控制器
    PTTopStatusViewController *topVC = [[PTTopStatusViewController alloc] init];
    [self addChildViewController:topVC];
    [self.view addSubview:topVC.view];
    [topVC didMoveToParentViewController:self];
    
    // 创建底部功能模块控制器
    PTButtomFuncViewController *bottomVC = [[PTButtomFuncViewController alloc] init];
    [self addChildViewController:bottomVC];
    [self.view addSubview:bottomVC.view];
    [bottomVC didMoveToParentViewController:self];
    
    // 设置约束
    [topVC.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.top.equalTo(self.view);
        make.height.equalTo(@30);
    }];
    
    [bottomVC.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.view);
        make.top.equalTo(topVC.view.mas_bottom);
    }];
}


@end
